package com.yunji.cabinet.engine.generate;

import cn.hutool.core.date.DateUtil;
import com.yunji.system.context.SystemUtil;

import java.util.concurrent.TimeUnit;

import static cn.hutool.core.date.DatePattern.PURE_DATE_PATTERN;

public class CabinetDataCodeGenerate {

    public static String generateDateCode(String prefix) {
        String currentTime = DateUtil.format(DateUtil.date(), PURE_DATE_PATTERN); // 格式：yyyyMMdd
        String key = prefix+ currentTime;
        return key + SystemUtil.getIncrementKey(key,1, TimeUnit.DAYS);
    }
}
